<template>
    <div class="reports">
        <div id="repost">

        </div>
    </div>
</template>
<script>
import * as echarts from 'echarts';
import { getlist } from '../../utlis/api//repost/repost'
export default {
    data() {
        return {
            a: {}
        }
    },
    methods: {

    },
    created() {

    },
    mounted() {
        getlist().then((res) => {
            console.log(20, res);
            this.a = res.data.data
            console.log(27, this.a);
            var myChart = echarts.init(document.getElementById('repost'));
            myChart.setOption(
                {
                    title: {
                        text: '用户来源'
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'cross',
                            label: {
                                backgroundColor: '#6a7985'
                            }
                        }
                    },
                    legend:
                        this.a.legend,
                    toolbox: {
                        feature: {
                            saveAsImage: {}
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: this.a.xAxis,
                    yAxis: this.a.yAxis,
                    series: this.a.series
                }
            );
        })


    }
}
</script>
<style lang="scss" scoped>
#repost {
    width: 100%;
    height: 600px;
}
</style>